package com.ganmiao.web.portal.controller;

import com.ganmiao.server.supplier.entity.TenderProduct;
import com.ganmiao.server.supplier.service.TenderProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/tenders_products")
public class TenderProductController {
    @Autowired
    private TenderProductService tenderProductService;

    @PostMapping("/insert")
    public int tendersProductsInsert(@RequestBody TenderProduct tenderProduct){
        return tenderProductService.tendersProductsInsert(tenderProduct);
    }

    @GetMapping("/get")
    public TenderProduct tenderProductsGet(@RequestParam Integer id){
        return tenderProductService.tendersProductsGet(id);
    }

    @PutMapping("/put/{id}")
    public void tendersProductsUpdate(@PathVariable Integer id, @RequestBody TenderProduct tenderProduct) {
        tenderProductService.tendersProductsUpdate(id, tenderProduct);
    }

    @DeleteMapping("/delete/{id}")
    public void tendersProductsDelete(@PathVariable Integer id) {
        tenderProductService.tendersProductsDelete(id);
    }
}
